//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.xxxy.jsq.action.distrib;

import com.xxxy.jsq.dao.DistribDao;
import com.xxxy.jsq.model.Distrib;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet({"/addDistribServlet"})
public class addDistribServlet extends HttpServlet {
    public addDistribServlet() {
    }

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
        request.setCharacterEncoding("UTF-8");
        response.setCharacterEncoding("UTF-8");
        response.setContentType("text/html;charset=UTF-8");
        Distrib model = new Distrib();
        DistribDao dao = new DistribDao();
        model.setRoleId(Long.parseLong(request.getParameter("roleId")));
        model.setWorksId(Long.parseLong(request.getParameter("worksId")));
        model.setDistribMemo(request.getParameter("distribMemo"));
        model.setDistribFlag("0");
        String result = dao.add(model);
        PrintWriter out = response.getWriter();
        out.print(result);
        out.flush();
        out.close();
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
        this.doPost(request, response);
    }
}
